package com.gdcn.zb.sys.service.impl;

import java.util.List;

import com.gdcn.zb.base.BaseService;
import com.gdcn.zb.base.exception.DaoException;
import com.gdcn.zb.base.exception.ServiceException;
import com.gdcn.zb.sys.dao.ITypeEconomicDao;
import com.gdcn.zb.sys.service.ITypeEconomicService;
import com.gdcn.zb.sys.valueobject.Summary;
import com.gdcn.zb.sys.valueobject.TypeEconomic;

public class TypeEconomicServiceImpl  extends BaseService implements ITypeEconomicService {
	private ITypeEconomicDao typeEconomicDao;
	public void setTypeEconomicDao(ITypeEconomicDao typeEconomicDao) {
		this.typeEconomicDao = typeEconomicDao;
	}

	public TypeEconomic findTypeEconomicById(int id) throws ServiceException {
		TypeEconomic typeEconomic = null;
		try{
			typeEconomic = typeEconomicDao.findTypeEconomicById(id);
		}catch (DaoException e) {
			logger.error(e);
			throw new ServiceException(e);
		}
		return typeEconomic;
	}

	public List listTypeEconomicOfAll() throws ServiceException {
		List list = null;
		try{
			list = typeEconomicDao.listTypeEconomicOfAll();
		}catch (DaoException e) {
			logger.error(e);
			throw new ServiceException(e);
		}
		return list;
	}

	public List listTypes(String parentcode) throws ServiceException {
		List list = null;
		try{
			list = typeEconomicDao.listTypes(parentcode);
		}catch (DaoException e) {
			logger.error(e);
			throw new ServiceException(e);
		}
		return list;
	}


}
